
** Currency Flotation and Dividend Policies: Evidence from China's Central Parity Reform
*******************************************************************************			 
// Figure 1
clear all
use fx_volatility.dta,clear

replace volatility=. if ym==667
twoway (bar volatility ym, yaxis(1) color(black) barwidth(0.6)) ///
	   (tsline usd_cny, yaxis(2) lpattern(dash) lcolor(gray) lwidth(medium)), ///
	   graphregion(fcolor(white)) xlabel(600(24)719) xline(667) ///
	   ylabel(0(0.01)0.07) ylabel(5(0.5)7,axis(2)) ///
	   xtitle("Year_Month") ytitle("Exchange Rate Volatility")  ///
	   ytitle("Exchange Rate Level",axis(2)) /// 	
   	   legend (col(2) region(lcolor(white)) order(1 "USD-RMB Volatility" 2 "USD-RMB Level(Right axis)"))
	

*******************************************************************************			 
*******************************************************************************			 
** Regression results
clear
use sample.dta,clear

encode indus, gen (industry)
encode stkcd, gen (firm)

*******************************************************************************			 
// Table 1 Summary statistics
// Panel A Statistics
tabstat div_yield stock_div dps payout_ratio1 payout_ratio2 div_yield_total ///
	fx_beta post abs_fxgl fx_loss hedge overseas_rev size roe lev asset_growth ///
	ocf tangible capex admin_rev seo, stat(n sd mean p25 median p75) ///
	columns(statistics) format (%9.3f)

// Panel B Year breakdown
bysort year:tabstat div_yield, stat(n mean)	columns(statistics)

// Panel C Industry breakdown
gen indus_code=substr(indus,1,1)
bysort indus_code:tabstat div_yield, stat(n mean)	columns(statistics) 

// Panel D Correlation
pwcorr_a div_yield stock_div fx_beta post abs_fxgl hedge size ///
		 roe lev asset_growth ocf tangible capex admin_rev seo ///
		 ,format(%6.3f) star1(0.01) star5(0.05) star10(0.1)  

		 
*******************************************************************************			 
// Table 2 Baseline results
global cv size roe lev asset_growth ocf tangible capex admin_rev seo
gen fx_beta_post=fx_beta*post

reghdfe div_yield fx_beta_post fx_beta  ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table2, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield fx_beta_post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table2, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 
*******************************************************************************			 
// Table 3 Parallel trend
tab year, gen(yr) //yr1-yr11: 2010-2020
gen fx_beta_y2010 = fx_beta*yr1
gen fx_beta_y2011 = fx_beta*yr2
gen fx_beta_y2012 = fx_beta*yr3
gen fx_beta_y2013 = fx_beta*yr4
gen fx_beta_y2014 = fx_beta*yr5
gen fx_beta_y2015 = fx_beta*yr6
gen fx_beta_y2016 = fx_beta*yr7
gen fx_beta_y2017 = fx_beta*yr8
gen fx_beta_y2018 = fx_beta*yr9
gen fx_beta_y2019 = fx_beta*yr10
global pre fx_beta_y2011 fx_beta_y2012 fx_beta_y2013 fx_beta_y2014 
global post fx_beta_y2015 fx_beta_y2016 fx_beta_y2017 fx_beta_y2018 fx_beta_y2019

reghdfe div_yield $pre $post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table3, excel bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)

// Figure 2 Parallel trend plot
coefplot, levels(90) keep($pre $post) vertical ///
	coeflabels(fx_beta_y2011=2011 fx_beta_y2012=2012 fx_beta_y2013=2013 ///
	fx_beta_y2014=2014 fx_beta_y2015=2015 fx_beta_y2016=2016 ///
	fx_beta_y2017=2017 fx_beta_y2018=2018 fx_beta_y2019=2019) ///
	yline(0,lwidth(vthin) lpattern(dash) lcolor(teal)) ///
	xline(5,lwidth(vthin) lpattern(dash) lcolor(teal)) ///
	ylabel(,labsize(*0.75) angle(0)) xlabel(,labsize(*0.75)) ///
	ytitle("Coefficients for Dividend Yield") xtitle("Year") ///
	msymbol(O) msize(small) mcolor(gs1) ///
	addplot(line @b @at,lcolor(gs1) lwidth(medthick)) ///
	ciopts(recast(rcap) lwidth(thin) lpattern(dash) lcolor(gs2)) ///
	graphregion(color(white)) 

	
*******************************************************************************			 
// Table 4 Conditional effects of hedging
// Panel A Conditional on Hedge_2014
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if hedge14==1, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table4, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if hedge14==0, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table4, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 *Coefficient difference
xtset firm
xtreg div_yield fx_beta_post fx_beta $cv i.year if hedge14==1,fe
	estimates store m1
xtreg div_yield fx_beta_post fx_beta $cv i.year if hedge14==0,fe
	estimates store m2
suest m1 m2, cluster(stkcd)
test [m1_mean]fx_beta_post=[m2_mean]fx_beta_post	 

// Panel B Conditional on Hedge_pre
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if hedge_pre==1, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table4, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if hedge_pre==0, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table4, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 *Coefficient difference
xtset firm
xtreg div_yield fx_beta_post fx_beta $cv i.year if hedge_pre==1,fe
	estimates store m1
xtreg div_yield fx_beta_post fx_beta $cv i.year if hedge_pre==0,fe
	estimates store m2
suest m1 m2, cluster(stkcd)
test [m1_mean]fx_beta_post=[m2_mean]fx_beta_post	 


*******************************************************************************			 
// Table 5 Conditional effects of financial flexibility
// Panel A Conditional on current ratio
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if current_ratio_rank==0, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table5, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if current_ratio_rank==1, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table5, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 *Coefficient difference
xtset firm
xtreg div_yield fx_beta_post fx_beta $cv i.year if current_ratio_rank==0,fe
	estimates store m1
xtreg div_yield fx_beta_post fx_beta $cv i.year if current_ratio_rank==1,fe
	estimates store m2
suest m1 m2, cluster(stkcd)
test [m1_mean]fx_beta_post=[m2_mean]fx_beta_post	 

// Panel B Conditional on earning volatility
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if roe_vol_rank==1, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table5, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if roe_vol_rank==0, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table5, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 *Coefficient difference
xtset firm
xtreg div_yield fx_beta_post fx_beta $cv i.year if roe_vol_rank==1,fe
	estimates store m1
xtreg div_yield fx_beta_post fx_beta $cv i.year if roe_vol_rank==0,fe
	estimates store m2
suest m1 m2, cluster(stkcd)
test [m1_mean]fx_beta_post=[m2_mean]fx_beta_post	


*******************************************************************************			 
// Table 6 Asymmetric responses of cash dividends
// Panel A Compare the magnitude
ttest abs_fxgl,by(post)	
ttest abs_fxgl if fxgl_indicator==1,by(post)	
ttest abs_fxgl if fxgl_indicator==-1,by(post)	
	*fxgl_indicator equals 1 for FX gains and equals -1 for FX loss

// Panel B Asymmetric impact
gen abs_fxgl_loss=abs_fxgl*loss
reghdfe div_yield abs_fxgl_loss abs_fxgl loss $cv ///
	if year>=2015, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table6, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield abs_fxgl_loss abs_fxgl loss $cv ///
	if year>=2015 & abs_fxgl~=0, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table6, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 
*******************************************************************************			 
// Table 7 Placebo test
reghdfe stock_div fx_beta_post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	outreg2 using Table7, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)

	
*******************************************************************************			 
// Table 8 Robustness: Alternative measures and specifications
// Panel A Alternative measure of cash dividend
reghdfe dps fx_beta_post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	outreg2 using Table8, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)
reghdfe payout_ratio1 fx_beta_post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	outreg2 using Table8, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)
reghdfe payout_ratio2 fx_beta_post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	outreg2 using Table8, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

// Panel B Alternative timing and measure of exposure
gen fx_betapre_post=fx_beta_pre*post   
gen overseas_post=overseas_rev_lag*post

reghdfe div_yield fx_betapre_post $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table8, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield overseas_post overseas_rev_lag $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table8, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

// Panel C Tobit regression
xttobit div_yield fx_beta_post fx_beta $cv i.year, ll(0) tobit 
	outreg2 using Table8, excel bdec(3) rdec(3) tstat td(2) append addtext(Firm FE, Random, Year FE,Yes)

	
*******************************************************************************			 
// Table 9 Robustness: Sample adjustments
// Panel A Within dividend paying firms
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if div_yield>0, absorb(year firm) vce(cluster firm) keepsingletons
	outreg2 using Table9, excel  bdec(3) rdec(3) tstat td(2) adjr2 replace addtext(Firm FE,Yes,Year FE,Yes)
	 
// Panel B Including special cash fividends
reghdfe div_yield_total fx_beta_post fx_beta $cv ///
	, absorb(year firm) vce(cluster firm) keepsingletons
	outreg2 using Table9, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	
*******************************************************************************			 
// Table 10 Hedging choices and PSM matching
// Panel A PSM matching
tab hedge
	** Matching model
xi:probit hedge size roe lev ocf i.industry i.year,cluster(firm) robust
	outreg2 using Table10, excel bdec(4) rdec(2) tstat td(2) replace addstat(Pseudo R-squared, `e(r2_p)') addtext(Industry FE,Yes)
predict pscore if e(sample), pr
psmatch2 hedge, pscore(pscore) neighbor(1) common caliper(0.05) noreplacement ties
	** After matching
xi:probit hedge size roe lev ocf i.industry i.year if _weight != .,cluster(firm) robust
	outreg2 using Table10, excel bdec(4) rdec(2) tstat td(2) append addstat(Pseudo R-squared, `e(r2_p)') addtext(Industry FE,Yes)
	
// Panel B Covariate-balancing test
	** Before matching
ttest size,by(hedge)	
ttest roe,by(hedge)	
ttest lev,by(hedge)	
ttest ocf,by(hedge)	
	** After matching
ttest size if _weight!= .,by(hedge)	
ttest roe if _weight!= .,by(hedge)	
ttest lev if _weight!= .,by(hedge)	
ttest ocf if _weight!= .,by(hedge)	

// Panel C Results using matching sample
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if _weight != .& hedge==1, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table10, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)
reghdfe div_yield fx_beta_post fx_beta $cv ///
	if _weight != .& hedge==0, absorb(year firm) vce(cluster firm) keepsingletons
	 outreg2 using Table10, excel  bdec(3) rdec(3) tstat td(2) adjr2 append addtext(Firm FE,Yes,Year FE,Yes)

	 *Coefficient difference
xtset firm
xtreg div_yield fx_beta_post fx_beta $cv i.year if _weight != .& hedge==1,fe
	estimates store m1
xtreg div_yield fx_beta_post fx_beta $cv i.year if _weight != .& hedge==0,fe
	estimates store m2
suest m1 m2, cluster(stkcd)
test [m1_mean]fx_beta_post=[m2_mean]fx_beta_post	





